package com.wosai.register.model;

import java.util.Collection;
import java.util.Collections;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonIgnoreProperties(ignoreUnknown=true)
public class Employee extends MerchantBaseEntity implements UserDetails {
    @JsonProperty("user_id")
    private String id;
    @JsonProperty("user_name")
    private String username;
    @JsonProperty("password")
    private String password;
    @JsonProperty("user_status")
    private String status;
    @JsonProperty("user_discount")
    private String discountPriviledge;
    @JsonProperty("user_report")
    private String reportPriviledge;
    @JsonProperty("user_rtngoods")
    private String returnPriviledge;
    @JsonProperty("user_settingrights")
    private String systemSettingPriviledge;
    @JsonProperty("user_flag")
    private String userFlag;
    @JsonProperty("resv1")
    private String resv1;
    @JsonProperty("resv2")
    private String resv2;
    @JsonProperty("resv3")
    private String resv3;
    @JsonProperty("resv4")
    private String resv4;
    @JsonProperty("classno")
    private String classno;
    
    @JsonProperty(value="branch_id", required=true)
    protected String branchId;
    
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getDiscountPriviledge() {
        return discountPriviledge;
    }
    public void setDiscountPriviledge(String discountPriviledge) {
        this.discountPriviledge = discountPriviledge;
    }
    public String getReportPriviledge() {
        return reportPriviledge;
    }
    public void setReportPriviledge(String reportPriviledge) {
        this.reportPriviledge = reportPriviledge;
    }
    public String getReturnPriviledge() {
        return returnPriviledge;
    }
    public void setReturnPriviledge(String returnPriviledge) {
        this.returnPriviledge = returnPriviledge;
    }
    public String getSystemSettingPriviledge() {
        return systemSettingPriviledge;
    }
    public void setSystemSettingPriviledge(String systemSettingPriviledge) {
        this.systemSettingPriviledge = systemSettingPriviledge;
    }

    
    @Override
    @JsonIgnore
    public Collection<? extends GrantedAuthority> getAuthorities() {
        GrantedAuthority auth = new SimpleGrantedAuthority("ROLE_USER");
        return Collections.singletonList(auth);
    }
    @Override
    @JsonIgnore
    public boolean isAccountNonExpired() {
        return false;
    }
    @Override
    @JsonIgnore
    public boolean isAccountNonLocked() {
        return false;
    }
    @Override
    @JsonIgnore
    public boolean isCredentialsNonExpired() {
        return false;
    }
    @Override
    @JsonIgnore
    public boolean isEnabled() {
        return true;
    }
    
    
    public String getUserFlag() {
        return userFlag;
    }
    public void setUserFlag(String userFlag) {
        this.userFlag = userFlag;
    }
    public String getResv1() {
        return resv1;
    }
    public void setResv1(String resv1) {
        this.resv1 = resv1;
    }
    public String getResv2() {
        return resv2;
    }
    public void setResv2(String resv2) {
        this.resv2 = resv2;
    }
    public String getResv3() {
        return resv3;
    }
    public void setResv3(String resv3) {
        this.resv3 = resv3;
    }
    public String getResv4() {
        return resv4;
    }
    public void setResv4(String resv4) {
        this.resv4 = resv4;
    }
    public String getClassno() {
        return classno;
    }
    public void setClassno(String classno) {
        this.classno = classno;
    }
    public String getBranchId() {
        return branchId;
    }
    public void setBranchId(String branchId) {
        this.branchId = branchId;
    }
    
    
}
